﻿//02.Write a program that reads a string, reverses it and prints the result at the console.
//Example: "sample" -> "elpmas".

using System;
using System.Text;

namespace PrintReversed
{
    class PrintReversed
    {
        static void Main()
        {
            Console.Write("Enter a string: ");
            string input = Console.ReadLine();
            StringBuilder output = new StringBuilder();
            Console.WriteLine(Reverse(input, output));
        }
         
        private static string Reverse(string input, StringBuilder output)
        {
            for (int i = input.Length-1; i >= 0; i--)
            {
                output.Append(input[i]);
            }
            return output.ToString();
        }
    }
}
